<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>生成器的应用2</title>
	</head>
	<body>
		<script type="text/javascript">
				function frist(){
				setTimeout(()=>{
					let name='郑爽'
					zxc.next(name);
				},1000)
			}
				function two(){
				setTimeout(()=>{
					let dai='代孕';
					zxc.next(dai);
				},1000)
			}
					function three(){
				setTimeout(()=>{
					let tao='逃税';
					zxc.next(tao);
				},1000)
			}
			function * gen(){
			let names=yield frist();
			document.write(names);
			let dais=yield two();
			document.write(dais);
			let taos=yield three();
			document.write(taos);	
			}
			let zxc=gen();
			zxc.next();
		</script>
	</body>
</html>
